<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>后台管理</title>
<link href="__PUBLIC__/ht/css/main.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="__PUBLIC__/ht/js/jquery.js"></script>
</head>
<body>

<div class="aaa_pts_show_1">【 产品规格管理 】</div>

<div class="aaa_pts_show_2">
    
    <div class="aaa_pts_3">
      <form action="{:U('ProSpec/save')}" method="post" onsubmit="return ac_from();">
      <ul class="aaa_pts_5">
         <li>
            <div class="d1">规格名称:</div>
            <div>
              <input class="inp_1" name="spec_name" id="spec_name" value="<?php echo $spec_info['spec_name']; ?>"/>
            </div>
         </li>
         <li>
            <div class="d1">规格值:</div>
            <div>
              <input class="inp_1" name="spec_value" id="spec_value" value="<?php echo $spec_info['spec_value']; ?>"/><span style="color:red">*多个规格值用英文‘,’隔开</span>
            </div>
         </li>
         <li>
            <div class="d1">排 序:</div>
            <div>
              <input class="inp_1" name="sort" id="sort" value="<?php echo $spec_info['sort']?$spec_info['sort']:0; ?>"/>
            </div>
         </li>
         <li><input type="submit" name="submit" value="提交" class="aaa_pts_web_3" border="0">
         	<input type="hidden" name="spec_id" value="<?php echo $spec_info['id']; ?>">
         </li>
      </ul>
      </form>
         
    </div>
    
</div>
<script>
function ac_from(){
  //判断栏目名称
  var spec_name=document.getElementById('spec_name').value;
  var spec_value=document.getElementById('spec_value').value;
  var sort=document.getElementById('sort').value;
  if(spec_name.length<1){
	  alert('请输入规格名称！');
	  return false;
	}
  if(spec_value.length<1){
    alert('请输入规格值！');
    return false;
  }
  if(sort){
    var re = /^[0-9]{1,}$/;
    if(!sort.match(re)){
      alert('排序只能是整型！');
      return false;
    }
   
  }
  return true;
}

</script>
</body>
</html>
